import { BrowserRouter, Route, Routes } from "react-router-dom";
import { lazy, Suspense } from "react";

// const App = lazy(() => import("../App"));
const Login = lazy(() => import("../pages/login"));
const Home = lazy(() => import("../pages/home"));
const Content = lazy(() => import("../pages/content"));
const Article = lazy(() => import("../pages/article"));

const Router = () => {
  return (
    <BrowserRouter>
      <Suspense>
        <Routes>
          <Route path="/" element={<Login />} />
          <Route path="/login" element={<Login />} />
          <Route path="/home" element={<Home />}>
            <Route path="/home/content" element={<Content />} />
            <Route path="/home/article" element={<Article />} />
          </Route>
        </Routes>
      </Suspense>
    </BrowserRouter>
  );
};

export default Router;
